<p class="title"><span>指令列表（{{listParams.listTotal}}）</span></p>
<nz-table #nestedTable [nzData]="listParams.listData" [nzPageSize]="formParams.pageSize"
  [nzPageIndex]="formParams.pageNum" [nzTotal]="listParams.listTotal" (nzPageIndexChange)="pageChange($event, 'index')"
  (nzPageSizeChange)="pageChange($event, 'size')" [nzFrontPagination]="false" nzShowPagination nzShowSizeChanger>
  <thead>
    <tr>
      <th nzShowExpand></th>
      <th *ngFor="let item of listFirstHeader">{{ item.title }}</th>
    </tr>
  </thead>
  <tbody>
    <ng-template ngFor let-data [ngForOf]="nestedTable.data">
      <tr>
        <td nzShowExpand [(nzExpand)]="data.expand" (nzExpandChange)="expandDetail(data)"></td>
        <td *ngFor="let item of listFirstHeader">
          <span *ngIf="item.key === 'state'" class="status"
            [ngClass]="{'blue': data[item.key] === 1, 'green': data[item.key] === 2, 'defeat': data[item.key] === 3}">{{executionStatusMap[data[item.key]]}}</span>
          <span *ngIf="item.key === 'result'">
            <div class="result" [ngStyle]="{'background-color': resultColorMap[data[item.key]]}"></div>
            <span>{{resultMap[data[item.key]]}}</span>
          </span>
          <span *ngIf="item.key === 'instructionStatistics'">
            <span>总数：{{data.successNum + data.errorNum | avoidNull}} <br> 失败：{{data.errorNum |
              avoidNull}}</span>
          </span>
          <span nz-tooltip [nzTitle]="data[item.key] | avoidNull"
            *ngIf="item.key !== 'createTime' && item.key !== 'executionStatus' && item.key !== 'executionResult' && item.key !== 'status' ">
            <span *ngIf="data[item.key] && data[item.key].length > 20">{{data[item.key].substring(0, 20)}}...</span>
            <span *ngIf="data[item.key] && data[item.key].length <= 20">{{ data[item.key] | avoidNull}}</span>
          </span>
        </td>
      </tr>
      <tr [nzExpand]="data.expand">
        <td></td>
        <td colspan="24">
          <nz-table #innerTable [nzData]="data && data.children && data.children.length > 0 ? data.children : []"
            nzSize="middle" [nzShowPagination]="false">
            <thead>
              <tr>
                <th *ngFor="let item of listSecondHeader">{{ item.title }}</th>
              </tr>
            </thead>
  <tbody>
    <tr *ngFor="let data of innerTable.data">
      <td *ngFor="let item of listSecondHeader">
        <span *ngIf="item.key === 'state'" class="status"
          [ngClass]="{'blue': data[item.key] === 1, 'green': data[item.key] === 2, 'defeat': data[item.key] === 3}">{{executionStatusMap[data[item.key]]}}</span>
        <span *ngIf="item.key === 'result'">
          <div class="result" [ngStyle]="{'background-color': resultColorMap[data[item.key]]}"></div>
          <span>{{resultMap[data[item.key]]}}</span>
        </span>
        <span *ngIf="item.key === 'taskStatistics'">
          <span>总数：{{data.successNum + data.errorNum | avoidNull}} <br> 失败：{{data.errorNum |
            avoidNull}}</span>
        </span>
        <span nz-tooltip [nzTitle]="data[item.key] | avoidNull"
          *ngIf="item.key !== 'createTime' && item.key !== 'executionStatus' && item.key !== 'executionResult' && item.key !== 'taskStatistics' ">
          <span *ngIf="data[item.key] && data[item.key].length > 20">{{data[item.key].substring(0, 20)}}...</span>
          <span *ngIf="data[item.key] && data[item.key].length <= 20">{{ data[item.key] | avoidNull}}</span>
        </span>
      </td>
    </tr>
  </tbody>
</nz-table>
</td>
</tr>
</ng-template>
</tbody>
</nz-table>
